location=[];
dat_v=load('Velocity_ave_max.txt');
dat_s=[];
time_dispersion=[];

for i=0:230
Pic_Num=5000*i;

    %if (i==0)
    %    Pic_Num=5000;
    %end
    
    dat=load(strcat('Statistical_data_concentration_X_',int2str(Pic_Num),'.sta'));
    [nx,ny]=size(dat);
    sum=0;sum2=0;
    for j=1:nx
        if (j>800)
            distance=5+nx-j;
        else
            distance=j-5;
        end
        
        %sum=sum+distance*dat(j);
        sum=sum+(j-1)*dat(j);
        sum2=sum2+dat(j);
    end
    
    dat_s=[dat_s,sum2];
    location=[location,sum/sum2];
    
end

diff=[];
for i=10:230
    
    time_dispersion=[time_dispersion,(location(i)-location(i-9))/(dat_v((i)*40,1)*5000*(9))];
    diff=[diff,location(i)-location(i-1)];
end
